import request from '@/config/request'
import type { BannerForm } from '@/config/forms'

export default {
  getList: () => request.get('/backend/banners'),
  getItem: (id: number) => request.get(`/backend/banners/${id}`),
  create: (form: BannerForm) => request.post('/backend/banners/', form),
  update: (id: number, form: BannerForm) => request.post(`/backend/banners/${id}`, form),
  delete: (id: number) => request.delete(`/backend/banners/${id}`),
  onself: (ids: number[], status: boolean) =>
    request.post('/backend/banners/onself', { ids, status })
}
